<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>猿粪の日记-发布文章</title>
    <base th:href="@{/}">
    <meta charset="utf-8" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
          name="viewport"/>
    <link rel="stylesheet" th:href="@{/bootstrap/sys/css/ifream.css}">
    <link rel="stylesheet" th:href="@{/bootstrap/index/banner.css}">
    <link rel="stylesheet" th:href="@{/bootstrap/css/ifream/iconfont.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrap/index/text-effect/linkstyles.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/bootstrap/css/my-layer-div.css}"/>
    <style>

    </style>
</head>
<body>
<div id="header">
    <div class="header_content">
        <div class="header-banner">
            <div class="grid__item color-11">
                <a class="link link--yaku" th:href="@{/}">
                    <span>Y</span><span>u</span><span>a</span><span>n</span>
                </a>
            </div>
        </div>
        <div class="header-opt">
            <ul class="opt_ul">
                <li class="opt_li"><a th:href="@{/}"><i class="iconfont icon-huiyuan"></i>会员</a></li>
                <li class="opt_li"><a th:href="@{/}"><i class="iconfont icon-zhuti1"></i>主题</a></li>
                <li class="opt_li extend"><a th:href="@{/tool/toolNav}"><i class="iconfont icon-xiangzi"></i>工具</a></li>
                <li class="opt_li login" id="login_btn"><a th:href="@{/loginPage}"><i
                        class="iconfont icon-dengru"></i>登入</a></li>
                <li class="opt_li online_opt" id="online_btn">
                <span class="avatar">
                    <!--http://thirdqq.qlogo.cn/g?b=oidb&k=Pf4r0mHoCWm66OovCfEJnQ&s=100&t=1531640597-->
                    <img src="">
                </span>
                    <span class="user_info">
                    <span class="user_item logout"><a href="javascript:void(0);"><i class="iconfont icon-zhuye1"></i>我的主页</a></span>
                    <span class="user_item logout"><a th:href="@{/sys/userInfo}"><i class="iconfont icon-shezhi"></i>设置</a></span>
                    <span class="user_item logout"><a href="javascript:void(0);"><i class="iconfont icon-bangzhu"></i>帮助</a></span>
                    <span class="user_item logout"><a th:href="@{/signOut}"><i class="iconfont icon-tuichu1"></i>退出</a></span>
                </span>
                </li>
            </ul>
        </div>
    </div>
</div>
<div id="container">
    <!--搜索栏搜索内容-->
    <div id="main_content">
    </div>
</div>

<div id="footer">
    <div class="stand_by"><span class="support">本文由<a href="javascript:void(0);">兰州</a>提供技术支持</span>赣ICP备20000118号</div>
</div>
<script type="text/javascript" th:src="@{https://lib.baomitu.com/jquery/3.5.0/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap/js/layopen.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap/js/JSONUtil.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap/js/AjaxUtil.js}"></script>
<script>
    $(document).ready(function () {
        let TOKEN = null, VIEW = null;

        loadUser();


        // 标准方法定义
        function loadUser() {
            let url = "getToken";
            $.ajax({
                type: "post",
                url: url,
                data: {},
                dataType: 'json',
                async: 'false',
                error: function (e) {
                    // 啥也不做, 就当没有发生什么
                    $('#login_btn').css('display', 'block');
                    $('#online_btn').css('display', 'none');
                },
                success: function (result) {
                    result = JSONUtil.parseObj(result);
                    if (parseInt(result.code) === 200) {
                        TOKEN = result.data;
                        $('#login_btn').css('display', 'none');
                        $('#online_btn').css('display', 'block').find(".avatar img").attr('src', TOKEN.avatar);
                    } else {
                        console.log("获取当前登入用户异常哦, 请检查你的参数捏!");
                    }
                }
            });
        }

    });
</script>
</body>
</html>
